# 检查Java文件语法问题的脚本

$javaFiles = Get-ChildItem -Path "src\main\java" -Filter "*.java" -Recurse

foreach ($file in $javaFiles) {
    $content = Get-Content $file.FullName -Raw -Encoding UTF8
    
    # 检查是否有log.info语句破坏了方法链
    if ($content -match 'log\.info\([^)]*\);\s*\.[a-zA-Z]') {
        Write-Host "Found broken method chain in: $($file.Name)"
    }
    
    # 检查是否有import语句中间插入了其他代码
    if ($content -match 'import\s+[^;]+;\s*[^\r\n]*private\s+static\s+final\s+Logger') {
        Write-Host "Found Logger declaration in imports: $($file.Name)"
    }
    
    # 检查是否有缺少的注释开始符
    if ($content -match '^\s*\*\s+[^/]' -and $content -notmatch '/\*\*') {
        Write-Host "Found comment without /** in: $($file.Name)"
    }
}

Write-Host "Syntax check completed!"